package com.newcoder.huawei;

import java.util.*;

/**
 * 字符串排序
 */
public class HJ14 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int lineSize = Integer.parseInt(in.nextLine());
        List<String> stringList = new ArrayList<>(lineSize);
        while (in.hasNext()){
            stringList.add(in.nextLine());
        }
        Collections.sort(stringList);
        stringList.forEach(s -> System.out.println(s));
    }
}
